/**
 * Created with JetBrains WebStorm.
 * User: Eric
 * Date: 03/02/13
 * Time: 07:14
 * To change this template use File | Settings | File Templates.
 */


exports.requireLoggin = function(req, res,next) {
    if (req.session.user === undefined) {
        res.redirect("/login");
    }else{
        res.locals.user = req.session.user;
        next();
    }
}

exports.havePersonage = function(req, res,next) {
    if (req.session.user.personage === null) {
        res.redirect("/choosePersonage");
    }else{
        res.redirect("homepage");
    }
}

